package com.controladores.controlvehicular;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Multas extends Activity implements android.view.View.OnClickListener  {
	protected TextView fuenteMulta;
	ImageView evidencia;
	Button tomarEvidencia;
	Intent i;
	static final int fotografia = 0;
	Bitmap bmp;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_multas);
		fuenteMulta= (TextView)findViewById(R.id.tMulta);
		Typeface tipofuenteMulta = Typeface.createFromAsset(getAssets(),"inkedgod.ttf");
		fuenteMulta.setTypeface(tipofuenteMulta);
		tomarEvidencia = (Button)findViewById(R.id.btnTomarFoto);
		tomarEvidencia.setOnClickListener(this);

	}

	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_multas, menu);
		return true;
		
	}



	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()){
		case R.id.btnTomarFoto:
			i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
			startActivityForResult(i, fotografia);
			break;
			
		}
		
	}



	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode==RESULT_OK){
			Bundle extras = data.getExtras();
			bmp = (Bitmap)extras.get("data");
			evidencia.setImageBitmap(bmp);
		}
	}
	
	

}
